home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.plaf.basic;
-
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Dimension;
- import java.awt.Frame;
- import java.awt.Graphics;
- import java.awt.Insets;
- import java.awt.Point;
- import java.awt.Window;
-
- class BasicToolBarUI$DragWindow extends Window {
- Color borderColor;
- int orientation;
- Point offset;
-
- BasicToolBarUI$DragWindow(Frame f) {
- super(f);
- this.borderColor = Color.gray;
- this.orientation = 0;
- }
-
- public void setOrientation(int o) {
- if (((Window)this).isShowing()) {
- if (o == this.orientation) {
- return;
- }
-
- this.orientation = o;
- Dimension size = ((Component)this).getSize();
- ((Component)this).setSize(new Dimension(size.height, size.width));
- if (this.offset != null) {
- this.setOffset(new Point(this.offset.y, this.offset.x));
- }
-
- ((Component)this).repaint();
- }
-
- }
-
- public Point getOffset() {
- return this.offset;
- }
-
- public void setOffset(Point p) {
- this.offset = p;
- }
-
- public void setBorderColor(Color c) {
- if (this.borderColor != c) {
- this.borderColor = c;
- ((Component)this).repaint();
- }
- }
-
- public Color getBorderColor() {
- return this.borderColor;
- }
-
- public void paint(Graphics g) {
- Color temp = g.getColor();
- g.setColor(((Component)this).getBackground());
- Dimension size = ((Component)this).getSize();
- g.fillRect(0, 0, size.width, size.height);
- g.setColor(this.getBorderColor());
- g.drawRect(0, 0, size.width - 1, size.height - 1);
- g.setColor(temp);
- super.paint(g);
- }
-
- public Insets getInsets() {
- return new Insets(1, 1, 1, 1);
- }
- }
-